06. Unit Test Coverage

Section 5: Check Unit Test Coverage

Use IntelliJ to check code coverage. Our goal is to cover everything in the Security Service. Other teams will be maintaining our Image Service so we’ll focus strictly on the behavior of the Security Service.

**Using IntelliJ, We Scanned This Project to See Code Coverage.**<br> _Note: This project tested all necessary methods, but your percentages may vary from this._

Using IntelliJ, We Scanned This Project to See Code Coverage.
Note: This project tested all necessary methods, but your percentages may vary from this.

Your goal is to provide full coverage of all methods that implement the application requirements. You don’t need to test trivial methods like getters or setters, but you do need to make sure that all the lines in your other methods are reachable by the unit tests.

**Looking to the Left, We Can See All of the Code Has Been Covered.**

Looking to the Left, We Can See All of the Code Has Been Covered.

Optional Stand Out Task: Integration Tests

Create a FakeSecurityRepository class that works just like the PretendDatabaseSecurityRepository class (except without the property files). Create a second test class called SecurityServiceIntegrationTest.java and write methods that test our requirements as integration tests.

These tests can call service methods and then use JUnit Assertions to verify that the values you retrieve after performing operations are the expected values.